package com.shxzz.easy12306.services.ticket.common.constant;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * Redis 相关 Key 常量
 * @author shxzz
 * @create 2024-03-05-18:47
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class RedisKeyConstant {
    /**
     * 所有站点编码信息 hash field : 站点 code value ：站点名
     */
    public static final String ALL_STATION_CODE_INFO = "ticket-service:all-station-info";

    /**
     * 所有站点编码信息加载 分布式锁前缀
     */
    public static final String LOCK_LOAD_ALL_STATION_CODE_INFO = "ticket-service:lock:load-all-station-info";


    /**
     * 车站与地区映射表  hash  field：站点code value：地区名称
     */
    public static final String TRAIN_STATION_REGION_MAPPING = "ticket-service:train-station-region-mapping:";

    /**
     * 车站与地区映射表 分布式锁
     */
    public static final String LOCK_TRAIN_STATION_REGION_MAPPING = "ticket-service:lock:train-station-region-mapping:";

    /**
     * 两地区之间列车信息前缀  hash  field：列车id value：列车基本信息
     */
    public static final String REGION_TRAIN_INFO_PREFIX = "ticket-service:region-train-info:";

    /**
     * 两地区之间列车信息 分布式锁前缀
     */
    public static final String LOCK_REGION_TRAIN_INFO_PREFIX = "ticket-service:lock:region-train-info:";

    /**
     * 火车信息前缀
     */
    public static final String TRAIN_INFO_PREFIX = "ticket-service:train-info:";

    /**
     * 火车途径站点信息前缀
     */
    public static final String TRAIN_STOPOVER_STATION_INFO_PREFIX = "ticket-service:train-stopover-station-info:";

    /**
     * 两站点之间列车信息前缀  string  value：座位价格实体list
     */
    public static final String TRAIN_STATION_PRICE_PREFIX = "ticket-service:train-station-price:";

    /**
     * 列车车票剩余数量 前缀
     */
    public static final String TRAIN_REMAIN_TICKET_PREFIX = "ticket-service:train-remain-ticket:";

    /**
     * 列车车票剩余数量加载 分布式锁前缀
     */
    public static final String LOCK_LOAD_TRAIN_REMAIN_TICKET_PREFIX = "ticket-service:lock:load-train-remain-ticket:";


    /**
     * 列车购票 分布式锁前缀
     */
    public static final String LOCK_PURCHASE_TICKET_PREFIX = "ticket-service:lock:purchase-ticket:";

    /**
     * 列车购票 V2 版本 分布式锁前缀
     */
    public static final String LOCK_PURCHASE_V2_TICKET_PREFIX = "ticket-service:lock:purchase-ticket-v2:";

    /**
     * 购票令牌桶前缀 + trainId hash field : departure-arrival-type value ：座位余量
     */
    public static final String PURCHASE_TICKET_TOKEN_BUCKET_PREFIX = "ticket-service:purchase-ticket-token-bucket:";

    /**
     * 加载购票令牌桶 分布式锁前缀
     */
    public static final String LOCK_LOAD_PURCHASE_TICKET_TOKEN_BUCKET_PREFIX = "ticket-service:lock:load-purchase-ticket-token-bucket:";

    /**
     * 地区或站点名称信息
     */
    public static final String REGION_OR_STATION_NAME_INFO_PREFIX = "ticket-service:region-or-station-name-info:";

    /**
     * 所有站点名称信息
     */
    public static final String ALL_STATION_NAME_INFO = "ticket-service:all-station-name-info:";
}
